package com.tang.model.jdk;

import java.util.Observable;
import java.util.Observer;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/9/6 20:37
 * @Desc
 * @Remarks
 */
//知乎平台
public class Teacher implements Observer {

    private String name;

    public Teacher(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable observable, Object arg) {
        ZhihuStandard zhihuStandard = (ZhihuStandard) observable;
        Question question = (Question) arg;
        System.out.println("亲爱的：" + name + "老师，您好，你有一条来自" + zhihuStandard.getName() + "平台的问题待您回答！");
        System.out.println("【 问题 】 : " + question.getContent());
        System.out.println("-----------------------------------");
        System.out.println();
    }
}
